<?php
/**
 * admin service file Created by PhpStorm.
 * User: wumengmeng
 * Date: 2020/05/11
 * Time: 17:32
 */

namespace Modules\Admin\Service;

use HiCommon\Repository\UpkeepTypeRepository;

class UpkeepTypeService
{

    /**
     * 获取所有权限
     *
     * @return array
     */
    public function get_all()
    {
        try {
            $arr_option = [
                'order' => ['key' => 'id', 'value' => 'asc'],
                'field' => ['id', 'title'],
                'where' => ['status' => 1]
            ];
            $data = UpkeepTypeRepository::get_all($arr_option)->toarray();
            return hello_success('成功', $data);
        } catch (\Exception $exception) {
            return hello_error('失败', [], $exception->getMessage());
        }
    }
}